package actions;

import java.util.List;
import beans.File;


import com.opensymphony.xwork2.ActionSupport;
import controllers.AbstractController;


public class UserFiles extends ActionSupport {

	private static final long serialVersionUID = 1164809814839976523L;
	
	// -------------------------------------------------------------
	// Objects
	// -------------------------------------------------------------

	AbstractController controller = new AbstractController();

	private int idRender;
	private int idFile;
	private int idUser;
	private List<File> result;
	
	
	// -------------------------------------------------------------
	// Methods
	// -------------------------------------------------------------

	public String execute() {
		
		setResult(controller.getFilebyRenderandUserId(idUser, idRender));
		System.out.println("idRender = " +idRender+" idUser = " +idUser+ "Files returned = "+  getResult().size());
		return SUCCESS;
	}
	public List<File> getResult() {
		return result;
	}
	
	// setters and getters
	public int getIdFile() {
		return idFile;
	}
	public void setIdFile(int idFile) {
		this.idFile = idFile;
	}

	public void setResult(List<File> result) {
		this.result = result;
	}

	public int getIdRender() {
		return idRender;
	}
	public void setIdRender(int idRender) {
		this.idRender = idRender;
	}
	public int getIdUser() {
		return idUser;
	}
	public void setIdUser(int idUser) {
		this.idUser = idUser;
	}

}
